﻿@model DLM.Web.ViewModel.UserDetailPageView
@{
    ViewBag.Title = "都来米-会员信息";
    Layout = "~/Views/Shared/_Master.cshtml";
}
<script type="text/javascript">
    function onInvitateSuccessed() {
        ShowDialogMessage('right', "您的操作成功了，请等待该会员的回应！");
    }

    function onInvitateFalied(ajaxContext) {
        ShowDialogMessage("warn", ajaxContext.responseText);
    }
</script>
<div class="main">
    <div class="main_tab_2">
        <div class="main_tab_2_up">
            <ul>
                <li class="current"><a href="#">他的资料</a></li>
            </ul>
        </div>
        <div class="main_tab_2_down">
            <div class="box">
                <h3>
                    基本资料</h3>
                <div class="tr clearfix">
                    <label class="lb">
                        <s></s>姓名</label>
                    <div class="info">
                        @Html.DisplayFor(model => model.User.Name)
                    </div>
                </div>
                <div class="tr clearfix">
                    <label class="lb">
                        <s></s>&nbsp;</label><div class="album info">
                            <a>

                            @if (Model.User.Photo == "none_75_75.png")
                            {
                                        <img src="@Url.Content("~/Content/ad/none_75_75.png")" alt="头像" height="77px" width="77px"/>
                            }
                            else
                            { 
                               <img src="@Url.Content("~/Files/Photos/" + Model.User.UserID + "/Title/" + Model.User.Photo)" />
                            }
                              </a>
                                </div>
                </div>
                <div class="tr clearfix">
                    <label class="lb">
                        <s></s>性别</label>
                    <div class="info">
                        @if (Model.User.Gender.HasValue)
                        {
                            if (Model.User.Gender.Value == true)
                            {
                            <span>女</span>
                            }
                            else
                            {
                            <span>男</span>
                            }
                        }
                    </div>
                </div>
                <div class="tr clearfix">
                    <label class="lb">
                        <s></s>出生年月</label>
                    <div class="info">
                        @Html.DisplayFor(model => model.User.Birthday)</div>
                </div>
                <div class="tr clearfix">
                    <label class="lb">
                        <s></s>年龄</label>
                    <div class="info">
                        @Html.DisplayFor(model => model.User.Age)</div>
                </div>
                <div class="tr clearfix">
                    <label class="lb">
                        <s></s>现居地</label>
                    <div class="info">
                        @Html.DisplayFor(model => model.User.Location)</div>
                </div>
                @if (Request.IsAuthenticated)
                {
                         
             
                    <div class="tr clearfix">
                        <label class="lb">
                            <s></s>籍贯</label>
                        <div class="info">
                            @if (!string.IsNullOrEmpty(Model.Browser.NativePlace))
                            {
                               
                                @Html.DisplayFor(model => model.User.NativePlace)
                            }
                            else
                            {
                                <span>想要看会员的资料，请先完善您的资料</span>   
                            }
                        </div>
                    </div>
                    <div class="tr clearfix">
                        <label class="lb">
                            <s></s>婚姻状况</label>
                        <div class="info">
                            @if (!string.IsNullOrEmpty( Model.Browser.Marriage))
                            {
                                if (!string.IsNullOrEmpty( Model.User.Marriage))
                                {
                                    @Html.DisplayFor(model => model.User.Marriage)
                                }
                            }
                            else
                            {
                                <span>想要看会员的资料，请先完善您的资料</span>   
                            }
                        </div>
                    </div>
                    <div class="tr clearfix">
                        <label class="lb">
                            <s></s>身高</label>
                        <div class="info">
                            @if (!string.IsNullOrEmpty(Model.Browser.Stature))
                            {
                                @Html.DisplayFor(model => model.User.Stature)
                            }
                            else
                            {
                                <span>想要看会员的资料，请先完善您的资料</span>   
                            }
                        </div>
                    </div>
                    <div class="tr clearfix">
                        <label class="lb">
                            <s></s>体重</label>
                        <div class="info">
                            @if (Model.Browser.Weight.HasValue)
                            {
                                if (Model.User.Weight.HasValue)
                                { 
                                @Html.DisplayFor(model => model.User.Weight.Value)
                                }

                            }
                            else
                            {
                                <span>想要看会员的资料，请先完善您的资料</span>   
                            }
                        </div>
                    </div>
                    <div class="tr clearfix">
                        <label class="lb">
                            <s></s>学历</label>
                        <div class="info">
                            @if (!string.IsNullOrEmpty(Model.Browser.Education))
                            {
                                @Html.DisplayFor(model => model.User.Education)
                            }
                            else
                            {
                                <span>想要看会员的资料，请先完善您的资料</span>   
                            }
                        </div>
                    </div>
                    <div class="tr clearfix">
                        <label class="lb">
                            <s></s>职业</label>
                        <div class="info">
                            @if (!string.IsNullOrEmpty(Model.Browser.Job))
                            {
                                @Html.DisplayFor(model => model.User.Job)
                            }
                            else
                            {
                                <span>想要看会员的资料，请先完善您的资料</span>   
                            }
                        </div>
                    </div>
                    <div class="tr clearfix">
                        <label class="lb">
                            <s></s>收入</label>
                        <div class="info">
                            @if (!string.IsNullOrEmpty(Model.Browser.Income))
                            {
                                @Html.DisplayFor(model => model.User.Income)
                            }
                            else
                            {
                                <span>想要看会员的资料，请先完善您的资料</span>   
                            }
                        </div>
                    </div>
      
                    <div class="tr clearfix">
                        <label class="lb">
                            <s></s>房车</label>
                        <div class="info">
                            @if (!string.IsNullOrEmpty( Model.Browser.Car))
                            {
                                if (!string.IsNullOrEmpty( Model.User.Car))
                                {
                                    @Html.DisplayFor(model => model.User.Car)
                                }
                            }
                            else
                            {
                                <span>想要看会员的资料，请先完善您的资料</span>   
                            }
                        </div>
                    </div>
                    <div class="tr clearfix">
                        <label class="lb">
                            <s></s>父母</label>
                        <div class="info">
                            @if (!string.IsNullOrEmpty(Model.Browser.Parents))
                            {
                                @Html.DisplayFor(model => model.User.Parents)
                            }
                            else
                            {
                                <span>想要看会员的资料，请先完善您的资料</span>   
                            }
                        </div>
                    </div>
                    <div class="tr clearfix">
                        <label class="lb">
                            <s></s>个人独白</label>
                        <div class="info">
                            @Html.DisplayFor(model => model.User.Introduction)</div>
                    </div>
                    
                            if (Model.IsGreeted)
                            {
                    <h3>
                        联系方式</h3>
                    <div class="tr clearfix">
                        <label class="lb">
                            <s></s>手机号码</label>
                        <div class="info">
                            @Html.DisplayFor(model => model.User.Phone)</div>
                    </div>
@*         <div class="tr clearfix">
                        <label class="lb">
                            <s></s>QQ</label>
                        <div class="info">
                            @Html.DisplayFor(model => model.User.IM)</div>
                    </div>*@
                            }

@*
                            if (Model.Album != null)
                            {

                            }
                            else
                            {
                    <span>请您上传头像后在查看他的相册</span>
                            }*@
                    
                          
                   
                    <h3>
                        相册</h3>


                            if (Model.HasAlbum)
                            {
                         
                    <div class="tr clearfix">
                        <div class="photo_box">
                            <ul class="clearfix">
                                @if (Model.Album != null)
                                {
                                    foreach (var item in Model.Album)
                                    {

                                    <li><a href="@Url.Action("PhotoView", "User", new { id = item.PhotoID })">
                                        <img src="@Url.Content("~/Files/Photos/" + item.UserID + "/Album/Thumb/" + item.Url)" alt="img" /></a>
                                    </li>
    
                                    }
                                }
                            </ul>
                        </div>
                    </div>

                            }
                            else
                            {
                              <div class="tr clearfix">
                        <label class="lb">
                            <s></s>
                        </label>
                        <div class="info">
                            <span>请您上传照片后在查看他的相册</span>
                        </div>
                    </div>
                             
                            }
                }
                else
                {
                    <div class="tr clearfix">
                        <label class="lb">
                            <s></s>
                        </label>
                        <div class="info">
                            @*<a href="@Url.Action("Login", "Account")">想要看更多会员资料，请先登录！</a>*@
                            <a href="/Account/Login?ReturnUrl=/User/View/@Model.User.UserID">想要看更多会员资料，请先登录！</a>
                        </div>
                    </div> 
                }
                <div class="tr clearfix btn">
                    <label class="lb">
                        <s></s>&nbsp;</label>
                    <div class="info">
                        @if (Request.IsAuthenticated && Model.User.AccountName != User.Identity.Name)
                        {


                            using (Ajax.BeginForm("Invite", "Friend", new { id = Model.User.UserID }, new AjaxOptions { HttpMethod = "Post", OnSuccess = "onInvitateSuccessed", OnFailure = "onInvitateFalied" }))
                            {
                
                            <input type="submit" value="" class="addtofriend" />
                            
                            }
@*                      using (Ajax.BeginForm("Greet", "Friend", new { id = Model.User.UserID }, new AjaxOptions { HttpMethod = "Post", OnSuccess = "javascript:alert('好友添加成功');" }))
                                 {
                
                            <input type="button" value="" class="greeting" />
                            
                                 }*@
                           
                        }
@*<input type="button" value="" class="gift" />
                        <input type="button" value="" class="send_message" />*@
                    </div>
                </div>
            </div>
        </div>
    </div>
</div>
